<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
    <title>~A - ~A</title>
    <style type="text/css">

      body {
      margin: 10px 20px 20px 220px;
      padding: 0px;
      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
      font-size: small;
      text-align: justify;
      max-width: 50em;
      background-color: white;
      }

      a, a:visited {
      text-decoration: none;
      color: maroon;
      }

      /* index */

      div.index {
      position: fixed;
      top: 0px;
      left: 0px;
      width: 180px;
      height: 100%;
      margin: 0px;
      padding: 5px;
      font-size: 12px;
      background-color: #DCDCDC;
      border-right: thin black solid;
      }

      div.index ol {
      color: navy;
      margin: 0px;
      padding-left: 0px;
      }

      div.index ol li {
      list-style: none;
      }

      div.index ol li:before {
      display: marker;
      content: counter(heading1) ". ";
      counter-increment: heading1;
      }

      div.index ol ol {
      padding-left: 10px;
      font-size: 10px;
      list-style: none;
      counter-reset: heading2;
      }

      div.index ol ol li:before {
      display: marker;
      content: counter(heading1)"." counter(heading2)" ";
      counter-increment: heading2;
      }

      /* heading styles */

      body > h1 {
      margin-top: 0px;
      }

      h1 {
      margin-top: 40px;
      margin-bottom: 0px;
      color: #4682B4;
      }

      h1:before {
      display: marker;
      content: counter(chapter) ". ";
      counter-increment: chapter;
      counter-reset: section1;
      }

      h1 + p {
      margin-top: 5px;
      }

      h2 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h2:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "  ";
      counter-increment: section1;
      }

      h2 + p {
      margin-top: 0px;
      }

      h3 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h3:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "." counter(section2) "  ";
      counter-increment: section2;
      }

      h3 + p {
      margin-top: 0px;
      }

      h4 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h4:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "." counter(section2) "." counter(section3) "  ";
      counter-increment: section3;
      }

      h4 + p {
      margin-top: 0px;
      }

      /* generated content for images and tables */

      img:after {
      content: "[" counter(image) "] " attr(title);
      counter-increment: image;
      display: block;
      font-size: 10px;
      font-weight: bold;
      margin-top: 5px;
      margin-bottom: 20px;
      color: black;
      }

      table:after {
      content: "Table " counter(table) ": " attr(summary);
      counter-increment: table;
      display: table-caption;
      caption-side: bottom;
      font-size: 10px;
      font-weight: bold;
      margin-top: 5px;
      margin-bottom: 20px;
      white-space: nowrap;
      color: black;
      }

      /* code for examples, code and pathnames*/

      div.example table {
      color: black;
      }

      div.example, div.code, div.path, div.sequence {
      margin: 10px 0px;
      border: 1px black solid;
      padding: 10px;
      background-color: #F4F4F4;
      counter-reset: image;
      color: maroon;
      }

      div.example:before {
      content: "Example " counter(example);
      counter-increment: example;
      display: block;
      }

      div.example + p {
      margin-bottom: 0px;
      }

      div.code:before {
      content: "Code";
      }

      div.path:before {
      content: "Path";
      }

      div.sequence:before {
      content: "Sequence";
      }

      p.reference:before {
      display: marker;
      content: "[" counter(reference) "]";
      counter-increment: reference;
      font-weight: bold;
      margin-right: 5px;
      }

      div.code:before, div.example:before, div.path:before, div.sequence:before {
      font-weight: bold;
      font-size: 15px;
      margin-bottom: 20px;
      color: black;
      }

      pre {
      color: Green;
      margin: 0px;
      padding: 0px;
      }


      /* equation counter */

      e:after {
      content: "[" counter(equation) "]";
      counter-increment: equation;
      display: block;
      float: right;
      margin-right: 10px;
      }

      /* to prevent the CC image from being numbered */

      img[alt="Creative Commons License"] {
      display: inline;
      }

      img[alt="Creative Commons License"]:after {
      display: none;
      }

      div#cc {
      background-color: #DCDCDC;
      border: thin black solid;
      padding: 10px;
      font-size: 10px;
      }

      /* Table Design */
      /* http://www.duoh.com/csstutorials/csstables/ */
      #mytable {
      width: 700px;
      padding: 0;
      margin: 0;
      }

      caption {
      padding: 0 0 5px 0;
      width: 700px;
      font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      text-align: right;
      }

      th {
      font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      color: #4f6b72;
      border-right: 1px solid #C1DAD7;
      border-bottom: 1px solid #C1DAD7;
      border-top: 1px solid #C1DAD7;
      letter-spacing: 2px;
      text-transform: uppercase;
      text-align: left;
      padding: 6px 6px 6px 12px;
      background: #CAE8EA url(images/bg_header.jpg) no-repeat;
      }

      th.nobg {
      border-top: 0;
      border-left: 0;
      border-right: 1px solid #C1DAD7;
      background: none;
      }

      td {
      border-right: 1px solid #C1DAD7;
      border-bottom: 1px solid #C1DAD7;
      background: #fff;
      padding: 6px 6px 6px 12px;
      color: #4f6b72;
      }


      td.alt {
      background: #F5FAFA;
      color: #797268;
      }

      th.spec {
      border-left: 1px solid #C1DAD7;
      border-top: 0;
      background: #fff url(images/bullet1.gif) no-repeat;
      font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      }

      th.specalt {
      border-left: 1px solid #C1DAD7;
      border-top: 0;
      background: #f5fafa url(images/bullet2.gif) no-repeat;
      font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      color: #797268;
      }

    </style>
  </head>

  <!--
      (CC) 2003 Luke Crook. Some Rights Reserved.
      http://creativecommons.org/licenses/by/1.0
      This page is licensed under a Creative Commons License.

      Maintained by the Common Lisp Application Builder project at www.lispbuilder.org

      The entire styleguide was copied wholesale from http://www.markschenk.com/cssexp/publication/article.xml

      (CC) 2003 Mark Schenk. Some Rights Reserved.
      http://creativecommons.org/licenses/by/1.0
      This page is licensed under a Creative Commons License.
    -->

  <BODY BGCOLOR=#FFFFFF >

    <h1><a name="top" class=none> ~2:*~A - ~A</a></h1>

    <blockquote>
      <br>&nbsp;</br><h2><a name=abstract class=abstract>Abstract</a></h2>

      <p>
	LISPBUILDER-SDL-TTF provides a Lisp wrapper for the
	<a href="http://www.libsdl.org/projects/SDL_ttf/">SDL_TTF</a> library,
	and provides support for loading and rendering True-Type fonts in an
	SDL application. The SDL_TTF wrapper is in itself a wrapper around the
	FreeType 1.2 library, available at: <a href="http://www.freetype.org/">Freetype Homepage</a>.
	LISPBUILDER-SDL-TTF has a dependency on the LISPBUILDER-SDL package.
	LISPBUILDER-SDL-TTF is distributed under the
	<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
      </p>
      <p>
	<font color=red>Current Version:</font> The current version of LISPBUILDER-SDL-TTF is version <a href="#download">0.2</a>.
      </p>
<!--       <p> -->
<!-- 	<font color=red>Download shortcut:</font> <a href="http://www.balooga.com/lispbuilder/~A.zip">http://www.balooga.com/lispbuilder/~:*~A.zip</a>. -->
<!--       </p> -->
    </blockquote>

    <br>&nbsp;</br><h2><a class=none name="packageover">Package Overview</a></h2>
    <p>The TrueType library is automatically initialized and uninitialized by the LISPBUILDER-SDL package.
      The functions INIT-TTF and QUIT-TTF are added to the lists SDL:*EXTERNAL-INIT-ON-STARTUP* and
      SDL:*EXTERNAL-QUIT-ON-EXIT*. LISPBUILDER-SDL iterates over these lists in calls to SDL:INIT-SDL, SDL:QUIT-SDL
      and SDL:WITH-INIT in order to initialize or uninitialize any external libraries such as LISPBUILDER-SDL-TTF.</p>
    <p>To open a TrueType font use INITIALISE-FONT or the macro WITH-OPEN-FONT. LISPBUILDER-SDL-TTF allows more than
      one FONT to be used simultaneously within a single SDL application.
    </p>
    <p>
      LISPBUILDER-SDL-TTF has the concept of a *DEFAULT-FONT*. A FONT may be bound to *DEFAULT-FONT* by using
      INITIALISE-DEFAULT-FONT,  WITH-OPEN-FONT, or WITH-DEFAULT-FONT.
      All functions that take a &KEYword or &OPTIONAL FONT argument accept *DEFAULT-FONT* unless a FONT is specified.
      This makes calling functions a bit easier as the :FONT parameter need not be explicitely passed. For example:

      (GET-FONT-SIZE "TEXT" :SIZE :W), compared to
      (GET-FONT-SIZE "TEXT" :SIZE :W :FONT ANY-FONT)
    </p>
    <p>
      Functions and symbols exported from the LISPBUILDER-SDL-TTF package are
      accessible from the <code>LISPBUILDER-SDL-TTF:</code> prefix or the
      shorter form <code>SDL-TTF:</code> nickname.
    </p>

    <br>&nbsp;</br><h2><a class=none name="examplesimple">Simple Example</a></h2>
    <div class="example">
      <p>
	This example was created with the following code:
      </p>
      <p>
	<img src="ttf-hello-world.png" width="200" height="167" title="TTF Hello World!" alt="TTF Hello World!"/>
      </p>

      <pre>
  (sdl:with-init ()
    (sdl:window 320 240)
    (sdl-ttf:initialise-default-font)
    (sdl-ttf:draw-string-solid-* "Hello TTF World!" 25 50
			   :color (sdl:color :r 255 :g 0 :b 255))
    (sdl:with-events ()
      (:quit-event () t)
      (:video-expose-event () (sdl:update-display))))
      </pre>
    </div>

    <div class="index">
      <ol>
	<li><a href="#top">LISPBUILDER-SDL-TTF</a></li>
	<ol>
	  <li><a href="#abstract">Abstract</a></li>
	  <li><a href="#packageover">Package Overview</a></li>
	  <li><a href="#examplesimple">Simple Example</a></li>
	  <li><a href="#compatibility">Compatibility</a></li>
	  <li><a href="#download">Download</a></li>
	  <li><a href="#installation">Installation</a></li>
	  <li><a href="#build">Build Instructions</a></li>
	  <ol>
	    <li><a href="#buildwindows">Windows Instructions</a></li>
	    <li><a href="#buildlinux">Linux Instructions</a></li>
	  </ol>
	  <li><a href="#usage">Usage</a></li>
	  <li><a href="#examples">Examples</a></li>
	  <li><a href="#dependency">Dependencies</a></li>
	  <li><a href="#license">License</a></li>
	  <li><a href="#dictionar">LISPBUILDER-SDL-TTF dictionary</a></li>
	  <ol>
	    <li><a href="#dictionary">INDEX</a></li>
	  </ol>
	  <li><a href="#ack">Acknowledgements</a></li>
	</ol>
      </div>

      <br>&nbsp;</br><h2><a class=none name="dictionary">The ~A dictionary Index</h2>
	<ol>
	  ~{      <li><a href="#~A"><code>~:*~A</code></a>
	    ~}
	  </li>
	</ol>


      <br>&nbsp;</br><h2><a class=none name="compatibility">Compatibility</h2>
	<p>
	  The following table describes the status of the Lisp implementations that have been tested with
	  LISPBUILDER-SDL-TTF:
	</p>

	<table id="mytable" cellspacing="0" summary="Compatibility">
	  <tr>
	    <th><b>Lisp Implementation</b></th>
	    <th colspan="3"><b>LISPBUILDER-SDL-TTF Status</b></th>
	    <th><b>Comments</b></th>
	  </tr>
	  <tr>
	    <th colspan="1"></th>
	    <th><b>Win32</b></th>
	    <th><b>Linux</b></th>
	    <th><b>MacOS</b></th>
	    <th></th>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://clisp.cons.org/">CLISP v2.38</a>
	    </th>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="specalt" scope="row">
	      <a href="http://www.lispworks.com/">Lispworks v4.4.6 Personal</a>
	    </th>
	    <td class="alt" bgcolor="#60c060">Working</td>
	    <td class="alt" bgcolor="#60c060">Working</td>
	    <td class="alt" bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://www.franz.com/">Allegro Express 8.0</a>
	    </th>
	    <td bgcolor="#ff6060">Unknown</td>
	    <td bgcolor="#ff6060">Unknown</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="specalt" scope="row">
	      <a href="http://openmcl.clozure.com/">OpenMCL</a>
	    </th>
	    <td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
	    <td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
	    <td class="alt" bgcolor="#ff6060">Unknown</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://www.sbcl.org/">SBCL</a>
	    </th>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	</table>


	<br>&nbsp;</br><h2><a class=none name="download">Download</a></h2>
	<ul>
	  <li><font color=red>Development:</font> Available via anonymous SVN at:
	    <pre>
	      svn co https://lispbuilder.svn.sourceforge.net/svnroot/lispbuilder lispbuilder
	    </pre>
	  </li>
	  <li>
	    <font color=red>Stable:</font> The latest stable versions are available from the
	    <a href="http://sourceforge.net/project/showfiles.php?group_id=159740">LISPBUILDER-SDL repository on SourceForge.</a>
	  </li>
	  <li>
	    <font color=red>'Lisp Starter Pack':</font> The
	    <a href="http://www.balooga.com/lispbuilder/config.lisp">config.lisp</a> file for use
	    with the <a href="http://weitz.de/starter-pack/">Lisp Starter Pack</a>
	    from Edi Weitz.
<!-- 	    <font color=red>The Edi Weitz 'Starter Pack' Version:</font> The stable version of Lispbuilder,  -->
<!-- 	    suitable for the installation of installation ~2:*~A using the Lisp Starter Pack from Edi Weitz is can be downloaded from  -->
<!-- 	    <a href="http://www.balooga.com/lispbuilder/~2:*~A.zip">http://www.balooga.com/lispbuilder/~:*~A.zip</a>. -->
	  </li>
	</ul>

	<br>&nbsp;</br><h2><a class=none name="installation">Installation</a></h2>
	<p>See <a href="http://lispbuilder.sourceforge.net/index.html#installation">the LISPBUILDER documentation</a>
	  for installation instructions.
	</p>
	<br>&nbsp;</br><h2><a class=none name="build">Build Instructions</a></h2>
	<p>LISPBUILDER-SDL-TTF requires that a glue library <code>lispbuilder-sdl-ttf-glue</code> is also installed
	  in the library search path. <code>lispbuilder-sdl-ttf-glue</code> wraps the native font rendering functions
	  provided by <code>SDL_TTF</code> as these functions require that a <code>SDL_Color</code> struct is passed
	  by value. However CFFI only supports passing structs by reference.
	</p>
	<br>&nbsp;</br><h3><a class=none name="buildwindows">Windows Build Instructions</a></h2>
	<p><code>lispbuilder-sdl-ttf-glue</code> is installed as part of the <code>LISPBUILDER-SDL-TTF-BINARIES</code>
	  package into the directory <code>LISPBUILDER-SDL-TTF/BIN</code>.
	</p>
	<p>To rebuild the glue library:
	  <ol>
	    <li>A working installation of <a href="http://www.mingw.org/">MingW</a> is required.</i>
	    <li>Make sure that the path to the include files for SDL and SDL_TTF are specified
	      correctly in <code>LISPBUILDER-SDL-TTF/Makefile.mingw</code>. Modify the existing line
	      <code>SDL_TTF_CFLAGS=$(CFLAGS) -ISDL-1.2.11/include -ISDL_ttf-2.0.8</code>.</li>
	    <li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make</code>
	      to create the glue library.</li>
	    <li>If the build is successful, the <code>lispbuilder-sdl-ttf-glue</code> library will be found in the
	      <code>LISPBUILDER-SDL-TTF/BUILD/</code> directory.</li>
	    <li>Copy or move this file <code>LISPBUILDER-SDL-TTF/BUILD/lispbuilder-sdl-ttf-glue.dll</code> to the
	      <code>BIN</code> directory <code>LISPBUILDER-SDL-TTF/BIN/lispbuilder-sdl-ttf-glue.dll</code></li>
	  </ol>
	</p>

	<br>&nbsp;</br><h3><a class=none name="buildlinux">Linux Build Instructions</a></h2>
	<p>To rebuild the glue library:
	  <ol>
	    <li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make</code>
	      to create the glue library.</li>
	    <li>If the build is successful, the <code>lispbuilder-sdl-ttf-glue</code> library will be found in the
	      <code>LISPBUILDER-SDL-TTF/BUILD/</code> directory.</li>
	    <li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make install_ttf</code>
	      to install the <code>lispbuilder-sdl-ttf-glue</code> library.</li>
	  </ol>
	</p>


	<br>&nbsp;</br><h2><a class=none name="usage">Using LISPBUILDER-SDL-TTF</a></h2>
	<p>See <a href="http://lispbuilder.sourceforge.net/index.html#usage">the LISPBUILDER documentation</a>
	  for Usage instructions.
	</p>

	<br>&nbsp;</br><h2><a class=none name="examples">Running Examples in LISPBUILDER-SDL-TTF-EXAMPLES</a></h2>
	<p>The following examples are contained in the package LISPBUILDER-SDL-TTF-EXAMPLES:
	</p>
	<ul>
	  <li>(SDL-TTF-EXAMPLES:FONT-EXAMPLE)</li>
	</ul>
	<p>Enter the following at the REPL to load the examples in the
	  LISPBUILDER-SDL-TTF-EXAMPLES package:</p>
	<pre>
	  (asdf:operate 'asdf:load-op :lispbuilder-sdl-TTF-examples)
	</pre>


	<br>&nbsp;</br><h2><a class=none name="dependency">Dependencies</a></h2>
	<p>LISPBUILDER-SDL-TTF has a dependency on LISPBUILDER-SDL.</p>


	<br>&nbsp;</br><h2><a class=none name="license">License</a></h2>
	<p>
	  LISPBUILDER-SDL-TTF is distributed under the
	  <a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
	</p>



	<br>&nbsp;</br><h2><a class=none name="dictionar">The ~A dictionary</a></h2>



